﻿
@using Shop.Bll;
@using System.Data;
@using Shop.ViewModel;
@using Shop.Help;
@using Shop.Bll;
@using Webdiyer.WebControls.Mvc
@{

    Layout = null;
}
@model  CommonDataRow
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="/Scripts/jquery-1.10.2.min.js"></script>
    <link href="/Content/admin/css/bootstrap.min.css" rel="stylesheet" />
    <script src="/Content/admin/js/bootstrap.min.js"></script>
    <script src="~/Content/My97DatePicker/WdatePicker.js"></script>
    <script src="~/Content/MvcPager/MvcPager.js"></script>
    <style>
        .navbar-form {
            padding: 0;
        }
    </style>
</head>
<body>
    <div class="container-fluid">
        <ol class="breadcrumb">
            <li><a href="/set/admin/center">首页></a></li>
            <li><a href="#">统计分析></a></li>
            <li class="active">代金券统计</li>
        </ol>
        <div class="portlet-body">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#tab_operator" data-toggle="tab">联盟代金券统计</a></li>
                <li><a href="#tab_business" data-toggle="tab">商户代金券统计</a></li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane active" id="tab_operator">
                    <div class="modal-body">

                        <form class="navbar-form navbar-left" id="formOperatorSearch" role="form" action="/Statistics/ChainStoreSmsNote/List">

                            <div class="form-group">
                                <input type="text" class="form-control input-sm" id="StoreName" name="StoreName" placeholder="请输入代金券名称" />
                                <input type="text" class="form-control input-sm" name="BuyTimeFrom" id="OperateTimeFrom" placeholder="领取时间" onclick="WdatePicker();" />
                                至
                                <input type="text" class="form-control input-sm" name="BuyTimeTo" id="OperateTimeTo" placeholder="领取时间" onclick="WdatePicker({ minDate: '#F{$dp.$D(\'OperateTimeFrom\')}' });" />
                            </div>
                            <button type="submit" class="btn btn-primary btn-sm ">
                                <span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>&nbsp;搜索
                            </button>

                        </form>
                        <div id="OperatorTable">
                            @Html.Partial("_Operator", Model.RowList1)
                        </div>
                    </div>
                </div>
                <div class="tab-pane" id="tab_business">
                    <div class="modal-body">
                        <form class="navbar-form navbar-left" id="formBusinessSearch" role="form" action="/Statistics/ChainStoreSmsNote/List">
                            <div class="form-group">
                                <input type="text" class="form-control input-sm" id="Content" name="Content" placeholder="请输入代金券名称" />
                                <input type="text" class="form-control input-sm" name="SendTimeFrom" id="SendTimeFrom" placeholder="领取时间" onclick="WdatePicker();" />
                                至
                                <input type="text" class="form-control input-sm" name="SendTimeTo" id="SendTimeTo" placeholder="领取时间" onclick="WdatePicker({ minDate: '#F{$dp.$D(\'OperateTimeFrom\')}' });" />
                            </div>
                            <button type="submit" class="btn btn-primary btn-sm ">
                                <span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>&nbsp;搜索
                            </button>
                        </form>
                        <div id="BusinessTable">
                            @Html.Partial("_Business", Model.RowList2)
                        </div>

                    </div>
                </div>

            </div>
            @section scripts{@{Html.RegisterMvcPagerScriptResource();}}
        </div>

        <script type="text/javascript">


            function GoPageIndex()
            {
                var pager = Webdiyer.MvcPagers[0];
                var pageIndex = $("#pageIndexBox").val().trim();
                var TotalPageCount = $("#TotalPageCount").val().trim();
                if (parseInt(pageIndex) > parseInt(TotalPageCount))
                {
                    pageIndex = TotalPageCount;
                }
                if (pager != null)
                {
                    pager.goToPage(parseInt(pageIndex));
                } else
                { alert("找不到指定的MvcPager！"); }

            }
            function InputPageIndex(obj)
            {
                var pageIndex = $(obj).val().trim();
                if (parseInt(pageIndex) > parseInt($("#TotalPageCount").val()))
                {
                    $(obj).val($("#TotalPageCount").val());
                }
            }

            function Success()
            {
                var txt = $("#SearchTitle").val().trim();
                if (txt.length > 0)
                {
                    $(".title").each(function ()
                    {
                        var newTxt = $(this).html().replace(txt, txt.fontcolor("red"));
                        $(this).html(newTxt);
                    });
                }

                $("input[name='PageSize']").val('@ViewData["NowPageSize"]');
                $("#PageSize").val(@ViewData["NowPageSize"]);
            }
        </script>
    </div>
</body>
</html>
